const HISTORY_LIST_TABLE_SQL = """
CREATE TABLE t_history
(
  friendId CHAR(19) PRIMARY KEY, 
  name CHAR(19), 
  content TEXT,
  time CHAR(20),
  unreadNum INTEGER
)
""";

class HistoryListModel {
  final String name;

  final String content;

  final String friendId;

  final String time;

  final int unreadNum;

  HistoryListModel(
      this.name, this.content, this.friendId, this.time, this.unreadNum);

  static HistoryListModel fromJson(Map<String, dynamic> map) {
    return HistoryListModel(map["name"], map["content"], map["friendId"],
        map["time"], map["unreadNum"]);
  }

  String toJson() {
    return """
    {
      "name" : "${name}",
      "content" : "${content}",
      "friendId" : "${friendId}",
      "time" : "${time}",
      "unreadNum" : "${unreadNum}"
    }
    """;
  }

  @override
  String toString() {
    return 'HistoryListModel{name: $name, content: $content, friendId: $friendId, time: $time, unreadNum: $unreadNum}';
  }
}
